/*
 * @Author: Administrator
 * @Date:   2017-11-11 11:03:00
 * @Last Modified by:   Administrator
 * @Last Modified time: 2018-01-03 10:07:45
 */
const path = require('path')
const webpack = require('webpack') 
const ROOT_PATH = path.resolve(__dirname); 
const vendors = ['react','react-dom','react-router','react-router-dom','whatwg-fetch','es6-promise', 'mobx', 'mobx-react', 'axios'];
module.exports = {
	devtool: false,
	entry: {    
		vendor: vendors  
	},
  output: {    
	 path: path.resolve(__dirname, 'dist/lib'),
    	filename: '[name].dll.js',
    	library: '[name]_lib',
	},
	plugins: [   
    new webpack.optimize.AggressiveMergingPlugin(),//合并块
	 	new webpack.optimize.UglifyJsPlugin({
        compress: {
          //supresses warnings, usually from module minification
          warnings: false
        }
	    }),
		new webpack.DefinePlugin({
	  	"process.env":{
	   		NODE_ENV:JSON.stringify('production')
	   	}
		}),  
		new webpack.DllPlugin({      
			path: path.resolve(ROOT_PATH, 'dist/lib', 'manifest.json'),
      name: '[name]_lib',
      context: ROOT_PATH,    
		})
	]
}
